<!-- 管理收货地址 -->
<template>
  <div class="address">
    <h1 style="font-size: 23px;">收货地址</h1>
    <!-- 分割线 -->
    <el-divider></el-divider>
    <!-- 收货地址组件 -->
    <addresses :userId="store.state.user.userId"></addresses>
  </div>
</template>

<script setup>
import { onMounted } from "vue";
import { useStore } from "vuex"
import Addresses from "../../../components/Addresses.vue";

const store = useStore();

onMounted(() => {
  // 事先清除address.js中存储的订单预览时选中收货地址，避免等一下删不掉地址
  store.commit('address/updateAddressId', '');
})
</script>

<style lang="less" scoped>
.address {
  background: linear-gradient(180deg, #ecf0f5ee 0%, #ffffffea 100%);
  padding: 30px;
  border-radius: 10px;

  /* 分割线 */

  .el-divider {
    border-top: 2px solid rgba(170, 165, 165, 0.651);
  }
}
</style>